package com.shuai.chatroom.service;

import com.shuai.chatroom.entity.FriendInfo;
import com.shuai.chatroom.entity.vo.FriendInfoVO;
import com.shuai.chatroom.mapper.FriendMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FriendService {
    @Resource
    private FriendMapper friendMapper;

    public List<FriendInfoVO> getFriendList(Integer uId) {
        return friendMapper.getFriendList(uId);
    }

    public boolean isFriend(Integer uId, Integer fId) {
        return friendMapper.isFriend(uId, fId) > 0;
    }

    public int addFriendRelationShip(FriendInfo friendInfo) {
        return friendMapper.addFriendRelationShip(friendInfo);
    }
}
